class Karma < ActiveRecord::Base
  validates_uniqueness_of :name
  
  
  def self.karma_for(points) 
    karma = Karma.find(:first, :conditions=>[":points>=min_value and :points<max_value",{:points=>points}])
    karma = karma || Karma.find(:first, :conditions=>["min_value=-1 and max_value=-1"])
  end
  
end
